import java.util.Scanner;
import java.util.Arrays;

public class Main3 {
    public static void main(String[] args) {
        Scanner num = new Scanner(System.in);
        int N = num.nextInt();
        int[] arr1 = new int[N];
        int[] arr2 = new int[N];
        for (int i = 0; i < N; i++) {
            arr1[i] = num.nextInt();
        }
        for (int i = 0; i < N; i++) {
            arr2[i] = num.nextInt();
        }
        int[] temp1 = new int[2 * N];
        int[] temp2 = new int[2 * N];
        for (int i = 0; i < 2 * N; i++) {
            if (i < N) {
                temp1[i] = arr1[i];
            } else {
                temp1[i] = arr2[i - N];
            }
        }
        Arrays.sort(temp1);
        temp2 = temp1;
        System.out.println(temp2[N-1]);
    }
}
